<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">

<body th:fragment="navbar">
<div class="row">
  <nav class="navbar navbar-fixed-top" role="navigation" style="margin-bottom: 0;min-height: 32px;">
  <div class="bg-primary" style="display: flex;align-items: center; height: 44px;padding: 0 16px;background-color: #0d6efd;">
      <div style="padding:4px 12px;margin-right: 12px;"><img th:src="@{/static/xcmg.png}" height="18"/></div>
      <div style="font-size:20px;font-weight: bold;">LK01立库管理系统</div>
    <div style="margin-left:auto;">
      <span sec:authorize="isAuthenticated()" style="margin-right:16px;">
        <a th:href="@{|/profile|}" class="navbar-a">
          <i class="fa fa-user"></i>
            <b sec:authentication="name"></b>
          </a>
      </span>
      <span>
<!--        <a th:href="@{/logout}" class="navbar-a">-->
        <a onclick="logout()" class="navbar-a">
          <i class="fa fa-sign-out"></i>退出
        </a>
      </span>
    </div>
  </div>
  </nav>
</div>

<script>
  function logout() {
      var result = confirm('确定退出当前系统？');
      if(result){
          window.location.href = "/logout";
      }
  }
</script>
</body>

</html>
